import Http, { request } from '../http';

export const login = function (loginForm: any) {
  console.log(123);

  return request.post('/admin/users/login', loginForm)
}

export const menu = function () {
  return Http.get('/user/menu')
}

export const permission = function () {
  return Http.get('/user/permission')
}

export function getUserList(params: any) {
  return request.get('/admin/users', params)
}

export function addUser(data: any) {
  return request.post('/admin/users', data)
}

export function updateUser(data: any) {
  return request.put(`/admin/users/${data.id}`, data)
}

export function deleteUser(id: string | any) {
  return request.delete(`/admin/users/${id}`)
}